import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Exclusive from "../views/Exclusive.vue";
import ImgNumSay from "../views/ImgNumSay.vue";
import China from "../views/China.vue";
import CharacterStory from "../views/CharacterStory.vue";
import Beautiful from "../views/Beautiful.vue";
import WuZhou from "../views/WuZhou.vue";
import Classroom from "../views/Classroom.vue";
import Periodicals from "../views/Periodicals.vue";
import ArticleDetail from "../views/ArticleDetail.vue";
import ChuXin from "../views/ChuXin.vue";
import ZhongGuoGuShi from "../views/ZhongGuoGuShi.vue";
import FirstRound from "../views/FirstRound.vue";

import BenKanPingLun from "../views/BenKanPingLun.vue";
import ZhuanTiBaoDao from "../views/ZhuanTiBaoDao.vue";
import DiQiuCun from "../views/DiQiuCun.vue";
import YuanShi from "../views/YuanShi.vue";
import ZhiYuanZhongGuo from "../views/ZhiYuanZhongGuo.vue";
import YiLuTongXing from "../views/YiLuTongXing.vue";
import ZhongHuaZhiMei from "../views/ZhongHuaZhiMei.vue";
import YiDaiYiLuQiYe from "../views/YiDaiYiLuQiYe.vue";

Vue.use(VueRouter);
const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
    meta: {
      isShow: true,
      title: "首页",
      content: {
        keywords:
          "五洲传播,中国时政,新闻,中国新闻发布,新时代中国人,读懂中国,中国,中国故事,五洲有约,中华之美,抗战精神,中国形象,人民英雄,文化交流,世界经济下的中国,新发展格局,时代楷模,一带一路,和平发展,中巴友谊,中伊关系",
        description:
          "《中国新闻发布》是中宣部主管、中宣部五洲传播出版传媒有限公司（五洲传播中心）主办的国家级外宣期刊。《中国新闻发布》坚持以习近平新时代中国特色社会主义思想为指导，深入学习宣传贯彻党的二十大精神，紧跟我国迈上全面建设社会主义现代化国家新征程、向第二个百年奋斗目标进军的伟大实践，重点对外宣介习近平总书记的思想和形象，生动讲好中国故事、中国共产党故事、新时代故事，向世界展现可信、可爱、可敬的中国形象，增强中华文明传播力影响力。",
      },
    },
  },
  {
    path: "/cxsm",
    name: "ChuXin",
    component: ChuXin,
    meta: {
      isShow: true,
      title: "初心使命",
      content: {
        keywords: "抗战精神 人民英雄 爱国 共产党 伟大复兴",
        description: "弘扬伟大抗战精神 坚持和平发展的道路",
      },
    },
  },
  {
    path: "/wdzggs",
    name: "ZhongGuoGuShi",
    component: ZhongGuoGuShi,
    meta: {
      isShow: true,
      title: "我的中国故事",
      content: {
        keywords: "中国故事 烟火中国 华籍 中国通",
        description: "中国新闻发布我的中国故事描述详情",
      },
    },
  },
  {
    path: "/benkanpinglun",
    name: "BenKanPingLun",
    component: BenKanPingLun,
    meta: {
      isShow: true,
      title: "本刊评论",
      content: {
        keywords: "中国新闻发布，本刊评论",
        description: "中国新闻发布本刊评论描述详情",
      },
    },
  },
  {
    path: "/ydyl",
    name: "YiDaiYiLuQiYe",
    component: YiDaiYiLuQiYe,
    meta: {
      isShow: true,
      title: "一带一路",
      content: {
        keywords: "中国新闻发布，一带一路",
        description: "中国新闻发布一带一路描述详情",
      },
    },
  },
  {
    path: "/ztbd",
    name: "ZhuanTiBaoDao",
    component: ZhuanTiBaoDao,
    meta: {
      isShow: true,
      title: "专题报道",
      content: {
        keywords: "江河之源 专题 成都大运会 长江生态 时政 专题报道",
        description: "江河之源 专题 成都大运会 长江生态 时政 专题报道",
      },
    },
  },
  {
    path: "/dqcmk",
    name: "DiQiuCun",
    component: DiQiuCun,
    meta: {
      isShow: true,
      title: "地球村面孔",
      content: {
        keywords: "中国新闻发布，地球村面孔",
        description: "中国新闻发布地球村面孔描述详情",
      },
    },
  },
  {
    path: "/yuanshiyuzg",
    name: "YuanShi",
    component: YuanShi,
    meta: {
      isShow: true,
      title: "院士与中国",
      content: {
        keywords: "院士 中国 无私奉献",
        description: "院士 中国 无私奉献",
      },
    },
  },
  {
    path: "/zhiyuanzg",
    name: "ZhiYuanZhongGuo",
    component: ZhiYuanZhongGuo,
  },
  {
    path: "/yilutongxing",
    name: "YiLuTongXing",
    component: YiLuTongXing,
    meta: {
      isShow: true,
      title: "一路同行",
      content: {
        keywords: "建交 中伊 中塔 文化交流 建交 一路同行",
        description: "建交 中伊 中塔 文化交流 建交 一路同行",
      },
    },
  },
  {
    path: "/zhonghuazm",
    name: "ZhongHuaZhiMei",
    component: ZhongHuaZhiMei,
    meta: {
      isShow: true,
      title: "中华之美",
      content: {
        keywords: "嵌瓷工艺 中国好茶 古建筑 博物馆 文物 文明智慧 中华之美",
        description: "嵌瓷工艺 中国好茶 古建筑 博物馆 文物 文明智慧 中华之美",
      },
    },
  },
  // 卷首发布
  {
    path: "/jsfb",
    name: "jsfb",
    component: FirstRound,
    meta: {
      isShow: true,
      title: "首卷发布",
      content: {
        keywords: "首卷发布,中巴经济，一带一路，中国经济",
        description:
          "高质量共建中巴经济走廊 谱写中巴命运共同体建设新篇章,中巴经济走廊引领两国全方位合作",
      },
    },
  },
  {
    path: "/zggjc",
    name: "Exclusive",
    component: Exclusive,
    meta: {
      isShow: true,
      title: "中国关键词",
      content: {
        keywords: "中巴经济 一带一路 新发展格局 以人民为中心",
        description:
          "高质量共建中巴经济走廊 谱写中巴命运共同体建设新篇章,中巴经济走廊引领两国全方位合作",
      },
    },
  },
  {
    path: "/fbjl",
    name: "ImgNumSay",
    component: ImgNumSay,
    meta: {
      isShow: true,
      title: "发布精览",
      content: {
        keywords: "中国新闻发布，发布精览",
        description: "中国新闻发布发布精览描述详情",
      },
    },
  },
  {
    path: "/sdjd",
    name: "China",
    component: China,
    meta: {
      isShow: true,
      title: "深度解读",
      content: {
        keywords: "中巴经济 一带一路 新发展格局 以人民为中心 深度解读",
        description:
          "高质量共建中巴经济走廊 谱写中巴命运共同体建设新篇章,中巴经济走廊引领两国全方位合作",
      },
    },
  },
  {
    path: "/xsddzgr",
    name: "CharacterStory",
    component: CharacterStory,
    meta: {
      isShow: true,
      title: "新时代的中国人",
      content: {
        keywords: "大国工匠 新时代的中国人 时代楷模 平凡英雄",
        description: "西陲戍边半世纪 我伴寂寞守繁华",
      },
    },
  },
  {
    path: "/xzc",
    name: "Beautiful",
    component: Beautiful,
    meta: {
      isShow: true,
      title: "新征程",
      content: {
        keywords: "乡村振兴 农业强国 集体经济 新征程",
        description: "携手并进20载，命运与共话未来",
      },
    },
  },
  {
    path: "/wzyy",
    name: "WuZhou",
    component: WuZhou,
    meta: {
      isShow: true,
      title: "五洲有约",
      content: {
        keywords: "承德 日照 都江堰  可可西里 湖北秭归 五洲有约",
        description: "承德 日照 都江堰  可可西里 湖北秭归 五洲有约",
      },
    },
  },
  {
    path: "/ddzg",
    name: "Classroom",
    component: Classroom,
    meta: {
      isShow: true,
      title: "读懂中国",
      content: {
        keywords: "战略合作伙伴 中国记忆 一带一路 建交 合作伙伴 友谊",
        description: "我的中国记忆 一带一路 回顾我的驻华经历",
      },
    },
  },
  {
    path: "/zxdk",
    name: "Periodicals",
    component: Periodicals,
    meta: {
      isShow: true,
      title: "在线读刊",
      content: {
        keywords: "中国新闻发布，在线读刊",
        description: "中国新闻发布在线读刊描述详情",
      },
    },
  },
  {
    path: "/articleDetail",
    name: "ArticleDetail",
    component: ArticleDetail,
    meta: {
      keepAlive: false,
    },
  },
  {
    path: "/search",
    name: "Search",
    component: () => import(/* webpackChunkName: "about" */ "../views/Search.vue"),
    meta: {
      keepAlive: false,
    },
  },
  {
    path: "/book",
    name: "Book",
    component: () => import(/* webpackChunkName: "about" */ "../views/Book.vue"),
    meta: {
      keepAlive: false,
    },
  },

  {
    path: "/about",
    name: "About",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ "../views/About.vue"),
  },
];

// const routes = [
//   {
//     path: "/",
//     name: "Home",
//     component: Home,
//     meta: {
//       isShow: true,
//       title: "首页",
//       content: {
//         keywords: "中国新闻发布,首页",
//         description: "中国新闻发布首页",
//       },
//     },
//   },
//   {
//     path: "/cxsm",
//     name: "ChuXin",
//     component: ChuXin,
//   },
//   {
//     path: "/wdzggs",
//     name: "ZhongGuoGuShi",
//     component: ZhongGuoGuShi,
//   },
//   {
//     path: "/benkanpinglun",
//     name: "BenKanPingLun",
//     component: BenKanPingLun,
//   },
//   {
//     path: "/ydyl",
//     name: "YiDaiYiLuQiYe",
//     component: YiDaiYiLuQiYe,
//   },
//   {
//     path: "/ztbd",
//     name: "ZhuanTiBaoDao",
//     component: ZhuanTiBaoDao,
//   },
//   {
//     path: "/dqcmk",
//     name: "DiQiuCun",
//     component: DiQiuCun,
//   },
//   {
//     path: "/yuanshiyuzg",
//     name: "YuanShi",
//     component: YuanShi,
//   },
//   {
//     path: "/zhiyuanzg",
//     name: "ZhiYuanZhongGuo",
//     component: ZhiYuanZhongGuo,
//   },
//   {
//     path: "/yilutongxing",
//     name: "YiLuTongXing",
//     component: YiLuTongXing,
//   },
//   {
//     path: "/zhonghuazm",
//     name: "ZhongHuaZhiMei",
//     component: ZhongHuaZhiMei,
//   },
//   // 卷首发布
//   {
//     path: "/jsfb",
//     name: "jsfb",
//     component: FirstRound,
//   },
//   {
//     path: "/zggjc",
//     name: "Exclusive",
//     component: Exclusive,
//   },
//   {
//     path: "/fbjl",
//     name: "ImgNumSay",
//     component: ImgNumSay,
//   },
//   {
//     path: "/sdjd",
//     name: "China",
//     component: China,
//   },
//   {
//     path: "/xsddzgr",
//     name: "CharacterStory",
//     component: CharacterStory,
//   },
//   {
//     path: "/xzc",
//     name: "Beautiful",
//     component: Beautiful,
//   },
//   {
//     path: "/wzyy",
//     name: "WuZhou",
//     component: WuZhou,
//   },
//   {
//     path: "/ddzg",
//     name: "Classroom",
//     component: Classroom,
//   },
//   {
//     path: "/zxdk",
//     name: "Periodicals",
//     component: Periodicals,
//   },
//   {
//     path: "/articleDetail",
//     name: "ArticleDetail",
//     component: ArticleDetail,
//     meta: {
//       keepAlive: false,
//     },
//   },
//   {
//     path: "/search",
//     name: "Search",
//     component: () => import(/* webpackChunkName: "about" */ "../views/Search.vue"),
//     meta: {
//       keepAlive: false,
//     },
//   },
//   {
//     path: "/book",
//     name: "Book",
//     component: () => import(/* webpackChunkName: "about" */ "../views/Book.vue"),
//     meta: {
//       keepAlive: false,
//     },
//   },

//   {
//     path: "/about",
//     name: "About",
//     // route level code-splitting
//     // this generates a separate chunk (about.[hash].js) for this route
//     // which is lazy-loaded when the route is visited.
//     component: () => import(/* webpackChunkName: "about" */ "../views/About.vue"),
//   },
// ];

// 防止连续点击多次路由报错
let routerPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return routerPush.call(this, location).catch((err) => err);
};
const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
